package com.micheal.mybatis.self;

import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by micheal on 2018/4/10/0010.
 */
public class MicConfiguration {

    public <T> T getMapper(Class<T> type, MicSqlSession micSqlSession) {
        return (T) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[]{type}, new MicMapperProxy(micSqlSession));
    }

    static class XmlTestMapper {

        public final static String namespace = "com.micheal.mybatis.self.mapper.TestMapper";
        public final static Map<String, String> methodSqlMapping = new HashMap<String, String>();

        static {
            methodSqlMapping.put("selectByPrimaryKey", "select * from test where id = ?");
        }

    }
}
